#ifndef __KEY_H
#define __KEY_H

#include "main.h"
#define KEY0_PIN GPIO_PIN_12
#define KEY0_PORT GPIOE
#define KEY0_EXTI_IRQn EXTI15_10_IRQn
#define KEY1_PIN GPIO_PIN_13
#define KEY1_PORT GPIOE
#define KEY1_EXTI_IRQn EXTI15_10_IRQn
#define KEY2_PIN GPIO_PIN_14
#define KEY2_PORT GPIOE
#define KEY2_EXTI_IRQn EXTI15_10_IRQn

typedef enum
{
    KEY_PRESS,
    KEY_RELEASE
}key_state_t;


typedef enum
{
    KEY_NONE,
    KEY_0,
    KEY_1,
    KEY_2,
}key_value_t;

void key_init(void);
key_value_t key_scan(void);

#endif
